package com.example.demospring;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class HomeController {
//    @GetMapping("/")
//    public String home() {
//        return "index";
//    }

    @GetMapping("/")
    public String showSystemInfo(Model model) {
        model.addAttribute("systemTime", SystemInfoUtils.getSystemTime());
        model.addAttribute("systemVersion", SystemInfoUtils.getSystemVersion());
        model.addAttribute("serverInfo", SystemInfoUtils.getServerInfo());

        return "index";
    }
}